//
//  BHApplyStepTableViewCell.swift
//  BigHealth
//
//  Created by 蔺百好 on 2021/6/18.
//

import UIKit

class BHApplyStepTableViewCell: UITableViewCell {
    
    @IBOutlet weak var upline: UILabel!
    @IBOutlet weak var downline: UILabel!
    
    @IBOutlet weak var time_label: UILabel!
    
    @IBOutlet weak var name_label: UILabel!
    
    
    @IBOutlet weak var signContentView: UIView!
    @IBOutlet weak var signBtn: UIButton!
    @IBOutlet weak var des_label: UILabel!
    
    /**
     0 报名赛事
     1 报名截止
     2 开始签到
     3 赛事开始
     4 赛事结束
     */
    var stepType: Int = 0 {
        didSet {
            self.upline.isHidden = stepType == 0
            self.downline.isHidden = stepType == 4
            self.signBtn.isHidden = stepType != 2
            self.signContentView.isHidden = stepType != 2
            if stepType == 0 {
                self.name_label.text = "报名赛事"
            }else if stepType == 1 {
                self.name_label.text = "报名截止"
            }else if stepType == 2 {
                self.name_label.text = "开始签到"
            }else if stepType == 3 {
                self.name_label.text = "赛事开始"
            }else {
                self.name_label.text = "赛事结束"
            }
        }
    }
    
    var signType: Bool = false {
        didSet {
            self.signBtn.isSelected = signType
            self.signBtn.backgroundColor = signType == true ? .color_FFF6E6:.color_FFEFEF
            self.signBtn.addLayerCorner(14, 0.5, signType == true ? .color_F59A22:.color_F67474)
            
            if signType == true {
                self.des_label.text = "待比赛结束后相关费用将在3个工作日内退回原账户。"
            }else {
                self.des_label.text = "如未按时签到，若存在押金等费用，押金将不再退回。"
            }
        }
    }
    
    
    
    
    override func awakeFromNib() {
        super.awakeFromNib()
        // Initialization code
    }

    override func setSelected(_ selected: Bool, animated: Bool) {
        super.setSelected(selected, animated: animated)

        // Configure the view for the selected state
    }
    
}
